﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="bookList.aspx.cs" Inherits="com.dz.web.admin.bookList" %>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>书籍列表</title>
    <link href="/admin/style/skin.css" rel="stylesheet" type="text/css" />
    <script src="/javascript/ajax.js" type="text/javascript"></script>
</head>
<body>
<script>
function GoQuery()
{
    var bookId=document.getElementById("<%=txtBookId.ClientID %>").value;
    var bookName=document.getElementById("<%=txtBookName.ClientID %>").value;
    var authorName=document.getElementById("<%=txtAuthorName.ClientID %>").value;
    var isVip=-1;
    var drpIsVip=document.getElementById("<%=drpVip.ClientID %>");
    for(var index=0;index<drpIsVip.options.length;index++)
    {
        if(drpIsVip.options[index].selected)
        {
            isVip=drpIsVip.options[index].value;
            break;
        }
    }
    var isExistImg=-1;
    var drpExistImg=document.getElementById("drpExistImg");
    for(var index=0;index<drpExistImg.options.length;index++)
    {
        if(drpExistImg.options[index].selected)
        {
            isExistImg=drpExistImg.options[index].value;
            break;
        }
    }
    var categoryName=document.getElementById("txtCategoryName").value;
    var subCategoryName=document.getElementById("txtSubCategoryName").value;
    document.location.href="bookList.aspx?bookId="+bookId+"&bookName="+escape(bookName)+"&authorName="+escape(authorName)+"&isVip="+isVip+"&isExistImg="+isExistImg+"&categoryName="+escape(categoryName)+"&subCategoryName="+escape(subCategoryName);
}
//添加推荐
function AddBookCommend(bookId,commendType)
{
   
    MyAjax.ExcuteScript(bookId,commendType,ShowCommendBack);
}
function ShowCommendBack(result)
{
    alert(result.value);
}
</script>
    <form id="form1" runat="server">

<table width="100%" border="0" cellpadding="0" cellspacing="0">
 <tr>
    <td width="17" valign="top" background="images/mail_leftbg.gif"><img src="images/left-top-right.gif" width="17" height="29" /></td>
    <td valign="top" background="images/content-bg.gif"><table width="100%" height="31" border="0" cellpadding="0" cellspacing="0" class="left_topbg" id="table2">
      <tr>
        <td height="31"><div class="titlebt">书籍列表</div></td>
        <td height="31" align="right"></td>
      </tr>
    </table></td>
    <td width="16" valign="top" background="images/mail_rightbg.gif"><img src="images/nav-right-bg.gif" width="16" height="29" /></td>
  </tr>
  <tr>
    <td valign="middle" background="images/mail_leftbg.gif">&nbsp;</td>
    <td valign="top" bgcolor="#F7F8F9">
    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="nowtable">
     <tr>
        <td  valign="top" width="100%">
        书ID：<asp:TextBox ID="txtBookId" runat="server"></asp:TextBox> &nbsp;
        书名：<asp:TextBox ID="txtBookName" runat="server"></asp:TextBox>&nbsp;
        作者：<asp:TextBox ID="txtAuthorName" runat="server"></asp:TextBox>&nbsp;
        是否VIP：<asp:DropDownList ID="drpVip" runat="server">
        <asp:ListItem Value="-1" Text="全部"></asp:ListItem>
        <asp:ListItem Value="1" Text="是"></asp:ListItem>
        <asp:ListItem Value="0" Text="否"></asp:ListItem>
        </asp:DropDownList>&nbsp;<br />
        是否有封面：<asp:DropDownList ID="drpExistImg" runat="server">
         <asp:ListItem Value="-1" Text="全部"></asp:ListItem>
        <asp:ListItem Value="1" Text="是"></asp:ListItem>
        <asp:ListItem Value="0" Text="否"></asp:ListItem>
        
        </asp:DropDownList>&nbsp;
        大分类：<asp:TextBox ID="txtCategoryName" runat="server"></asp:TextBox>
        &nbsp;
        小分类：<asp:TextBox ID="txtSubCategoryName" runat="server"></asp:TextBox>
        <input type="button" value="查询" onclick="GoQuery()" />
        </td>
        </tr>
    </table>
    <br />
    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
   
  
      <tr>
        <td  valign="top" width="100%">
    
          <table cellSpacing="0" cellPadding="0" width="100%">
             <tr >
             <td width="20%"><span class=""left_txt">书名</span></td>
      
               <td width="25%"><span class=""left_txt">简介</span></td>
               <td width="5%"><span class=""left_txt">是否VIP</span></td>
              <td width="10%"><span class=""left_txt">总字数</span></td>
       
                 <td width="20%" align="right"><span class="left_txt">操作</span></td>
             </tr>
               <tr>
        <td height="2" colspan="7"><table width="100%" height="1" border="0" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
          <tr>
            <td></td>
          </tr>
        </table></td>
      </tr>

             <asp:Repeater ID="rptBookList" runat="server">
             <ItemTemplate>
             <tr >
               <td width="20%" class="rptFont">&nbsp;<%# GetBookImg( Eval("bookId").ToString(), Eval("bookName").ToString(), Eval("isExistImage"),Eval("bookCategoryName").ToString(),Eval("bookSubCategoryName").ToString())%></td>
     
               <td width="25%" class="rptFont">&nbsp;<%# com.dz.common.SystemUtil.GetGBString( Eval("description").ToString(),100) %></td>
         <td width="5%" class="rptFont">&nbsp;<%#Eval("isVip") %></td>
              <td width="10%" class="rptFont">&nbsp;<%#Eval("wordscount") %></td>
              <td width="20%" class="rptFont">&nbsp;<%#Eval("lastupdatetime") %></td>
                <td width="20%" align="right"><a href="javascript:AddBookCommend('首页封推','<%#Eval("bookId").ToString()%>');">首页封推</a> &nbsp;<a href="javascript:AddBookCommend('重磅推荐','<%#Eval("bookId").ToString()%>');">重磅推荐</a>&nbsp;
                <a href="javascript:AddBookCommend('VIP推荐','<%#Eval("bookId").ToString()%>');">VIP推荐</a>&nbsp;
                 <a href="javascript:AddBookCommend('男生精选','<%#Eval("bookId").ToString()%>');">男生精选</a>&nbsp;
                  <a href="javascript:AddBookCommend('女生精选','<%#Eval("bookId").ToString()%>');">女生精选</a>
                  <a href="javascript:AddBookCommend('本类推荐','<%#Eval("bookId").ToString()%>');">本类推荐</a>
                </td>
                 </tr>
             </ItemTemplate>
             </asp:Repeater>
        
               
            </table></td>

   
      </tr>
      <tr>
        <td height="40"><table width="100%" height="1" border="0" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
          <tr>
            <td></td>
          </tr>
        </table></td>
      </tr>
       <tr>
      <td colspan="7" align="left"><asp:Label ID="lblPageHtml" runat="server"></asp:Label></td>
      </tr>
      <tr>
      <td width="100%">
      <table border="0" cellpadding="0" cellspacing="0">
     <tr>
        <td width="2%">&nbsp;</td>
        <td width="90%" class="left_txt"><img src="images/icon-mail2.gif" width="16" height="11"> 客户服务邮箱：274247323@qq.com<br>
              <img src="images/icon-phone.gif" width="17" height="14"> 官方网站：http://www.dazhongxiaoshuo.com</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
     </tr>
           </table>
      </td>
     
      </tr>
    </table>
    
    </td>
    <td background="images/mail_rightbg.gif">&nbsp;</td>
  </tr>
  <tr>
    <td valign="bottom" background="images/mail_leftbg.gif"><img src="images/buttom_left2.gif" width="17" height="17" /></td>
    <td background="images/buttom_bgs.gif"><img src="images/buttom_bgs.gif" width="17" height="17"></td>
    <td valign="bottom" background="images/mail_rightbg.gif"><img src="images/buttom_right2.gif" width="16" height="17" /></td>
  </tr>
</table>
</form>
</body>
</html>
